<template>


    <div>
      <h3 style="text-align: center;">供货退货审核</h3>
        <!--    商品展示-->
        <div style="margin-top: 20px">
            <el-table
                    :data="cutObj.records"
                    stripe
                    style="width: 95%"
                    :header-cell-style="{textAlign: 'center'}"
                    :cell-style="{ textAlign: 'center' }">
                <el-table-column
                        prop="idNum"
                        label="批次号"
                        width="">
                </el-table-column>
                <el-table-column
                        prop="orderIdNum"
                        label="订单编号">
                </el-table-column>
              <el-table-column
                  prop="shopPrice"
                  label="采购价">
              </el-table-column>
                <el-table-column
                        prop="orderPrice"
                        label="订单金额">
                </el-table-column>


                <el-table-column label="操作" width="450px">
                    <template #default="scope">
                        <el-button type="success" @click="updateStatusTo4(scope.row)">审核通过
                        </el-button>
                    </template>
                </el-table-column>

            </el-table>
        </div>
        <!--    分页-->
        <div style="margin-top: 20px">
            <el-pagination
                    v-model:current-page="currentPage"
                    v-model:page-size="pageSize"
                    background
                    layout="prev, pager, next, jumper"
                    :total="this.cutObj.total"
                    @current-change="findAll3"
            />
        </div>


        <!--详细信息弹窗-->
        <el-dialog
                v-model="show"
                width="80%"
        >
            <el-descriptions title="详细信息列表" direction="vertical" :column="4" border>
            </el-descriptions>

            <el-form :model="treeEach" ref="productForm">
                <el-form-item label="商品编号" prop="clientName">
                    {{ refundObj.userOrderIdNum }}
                </el-form-item>
                <el-form-item label="退款原因:" prop="cause">
                    {{ refundObj.cause }}
                </el-form-item>


            </el-form>
            <el-button style="margin-left: 400px" type="primary" @click="this.show=false">返回</el-button>


        </el-dialog>
        <!--审核不通过原因弹窗-->
        <el-dialog
                v-model="showAdd"
                width="60%"
        >
            审核不通过原因:
            <el-input v-model="msg"></el-input>
            <el-button type="success" @click=" back()">确认</el-button>

        </el-dialog>


    </div>

</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
    data() {
        return {
            cutObj: {},
            pageSize: 8,
            currentPage: 1,
            showDialog: false,
            refundObj: {},
            show: false,
            treeEach: '',
            row: {},
            showAdd: false,
            msg: ""

        }

    }, methods: {
    findAll3(pageNO) {
            axios.get("/project/orderInfo/findAll3/" + pageNO).then(n => {
                console.log(n.data);
                let info = n.data
                this.cutObj = info;
            })
        },  updateStatusTo4(row) {
            axios.get("/project/orderInfo/updateStatusTo4/" + row.idNum).then(n => {
                let info = n.data;
                if (info == "ok") {
                    ElMessage.success("审核通过");
                    this.findAll3(1);
                } else {
                    ElMessage.error("网络出错，请稍后...");
                }
            })
        }



    }, mounted() {
        this.findAll3(1);
    }

}
</script>

<style>

</style>